'use strict';
var myApp=angular.module('myApp',['ngRoute','myApp.services']);

myApp.controller('HomeController',function($scope,HitService){
    //HitService.count()
    //    .then(function(data){
    //        $scope.hits=data;
    //    });
    //console.log(123);
    //$scope.registerHit=function(){
    //    HitService.registerHit()
    //        .then(function(data){
    //            $scope.hits=data;
    //        })
    //};
console.log(123);
    $scope.submitFrom=function(){
        console.log($scope.user.name);
        console.log($scope.user.name);
        HitService.login($scope.user.name,$scope.user.password)
            .then(function(data){
                if(data.result=='success'){
                window.location='http://localhost:3000/lucky'
                }
            })
    };
});